package com.appology.users;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;

public class ChuckUser {

	public static final String ENTITY_TYPE = "ChuckUser";
	public static final String COLUMN_GOOGLE_ID = "googleId";
	public static final String COLUMN_BUZZ_ID = "buzzId";
	public static final String COLUMN_DISPLAY_NAME = "displayName";

	private String mGoogleId;
	private String mBuzzId;
	private String mDisplayName;

	public ChuckUser() {
		mGoogleId = null;
		mBuzzId = null;
		mDisplayName = null;
	}

	public ChuckUser(String googleId, String buzzId, String displayName) {
		mGoogleId = googleId;
		mBuzzId = buzzId;
		mDisplayName = displayName;
	}

	public Key save() {
		DatastoreService datastore = DatastoreServiceFactory
				.getDatastoreService();
		Entity user = new Entity(ENTITY_TYPE, mGoogleId);
		user.setProperty(COLUMN_GOOGLE_ID, mGoogleId);
		user.setProperty(COLUMN_BUZZ_ID, mBuzzId);
		user.setProperty(COLUMN_DISPLAY_NAME, mDisplayName);

		return datastore.put(user);
	}

	public String getGoogleId() {
		return mGoogleId;
	}

	public void setGoogleId(String googleId) {
		this.mGoogleId = googleId;
	}

	public String getBuzzId() {
		return mBuzzId;
	}

	public void setBuzzId(String BuzzId) {
		this.mBuzzId = BuzzId;
	}

	public String getDisplayName() {
		return mDisplayName;
	}

	public void setDisplayName(String DisplayName) {
		this.mDisplayName = DisplayName;
	}

}
